#ifndef LOADER_H
#define LOADER_H
#define M_NAME_MAX_SIZE 255+1
#define A_NAME_MAX_SIZE 15+1


typedef struct modinfo;
typedef struct apiinfo;

typedef struct{
    char name[A_NAME_MAX_SIZE];
    long mid;
    long iid;
    int* (*enter)();
}apiinfo;

typedef struct{
    char name[M_NAME_MAX_SIZE];
    long mid;
    int version;
    apiinfo* apis;
    int* (*main)();
}modinfo;

typedef struct{
    modinfo* pre;
    modinfo info;
    modinfo* next;
}modinfo_list;

int init();
modinfo creat_module(char name[M_NAME_MAX_SIZE],int version,void* enter);
apiinfo creat_api(modinfo modinfo,char name[A_NAME_MAX_SIZE]);
int init_module(modinfo*);
int init_api(apiinfo*);
int allco_mid(modinfo*);
int allco_iid(modinfo*,apiinfo*);

#endif